<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>鼠标事件</title>
	<style type="text/css">
		#box{
			width: 200px;
			height: 200px;
			background-color: yellow;
		}
	</style>
</head>
<body>
	<div id="box"></div>
</body>
<script type="text/javascript">
	var box = document.getElementById('box');

	//鼠标移入
	box.onmouseover = function(){
		this.style.backgroundColor = 'red';
	}
	//鼠标移出
	box.onmouseout = function(){
	    this.style.backgroundColor = 'yellow';	
	}
	//鼠标按下
	box.onmousedown = function(){
		this.innerHTML = '鼠标已经按下';
	}
	//鼠标抬起
	box.onmouseup = function(){
		this.innerHTML = '鼠标已经抬起';
	}
	//鼠标移动
	box.onmousemove = function(){
		this.innerHTML = '不要动';
	}
	
</script>
</html>